# $Id: PKGBUILD 78251 2012-10-17 10:27:06Z allan $
# Maintainer:
# Contributor: Angel 'angvp' Velasquez <angvp[at]archlinux.com.ve>
# Contributor: William Rea <sillywilly@gmail.com>

pkgbase=python-reportlab
pkgname=python2-reportlab
_origname=reportlab
pkgver=2.6
pkgrel=1
pkgdesc="A proven industry-strength PDF generating solution"
arch=('i686' 'x86_64')
url="http://www.reportlab.org/rl_toolkit.html"
depends=('python2' 'freetype2')
conflicts=('python-reportlab<=2.5-2')
replaces=('python-reportlab<=2.5-2')
license=('CUSTOM')
source=(http://www.reportlab.org/ftp/${_origname}-$pkgver.tar.gz)
md5sums=('e5d27a24a2c8456b168913242aa1940f')

build() {
    cd $srcdir/${_origname}-$pkgver

    # python2 fix
    for file in src/reportlab/graphics/widgets/table.py src/reportlab/lib/normalDate.py \
                src/reportlab/pdfgen/pycanvas.py; do
        sed -i 's_#!.*/usr/bin/env python_#!/usr/bin/env python2_' $file
    done
}

package_python2-reportlab() {
    cd $srcdir/${_origname}-$pkgver
    python2 setup.py install --root=$pkgdir --optimize=1
    install -D -m644 LICENSE.txt $pkgdir/usr/share/licenses/$pkgname/license.txt
}
